package com.test.aqs;

public enum  CountryEnum {
    ONE(1,"齐"),
    TWO(2,"楚"),
    THREE(3,"燕"),
    FOUR(4,"韩"),
    FIVE(5,"赵"),
    SIX(6,"魏"),
    ;
    private int code;
    private String message;

    CountryEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    //返回值
    public static CountryEnum getCountry(int code){
        CountryEnum[] array = CountryEnum.values();
        for (CountryEnum countryEnum : array) {
            if(countryEnum.code == code){
                return countryEnum;
            }
        }
        return null;
    }
 
}
